package no.sachmuld.methodcombination.examples.reflection.roles.employee.lib;

import no.sachmuld.methodcombination.api.MethodInvocation;
import no.sachmuld.methodcombination.examples.reflection.roles.employee.api.Consultant;

/**
 *
 */
public class ConsultantImpl extends EmployeeBehaviour implements Consultant {

    private double invoicingPercentage;

    @Override
    public void setInvoicingPercentage(double invoicingPercentage) {
        this.invoicingPercentage = invoicingPercentage;
    }

    @Override
    public int salary(MethodInvocation<Integer> methodInvocation) {
        return methodInvocation.proceed() + (invoicingPercentage > 0.8 ?  100000 : 0);
    }
}
